vmx: Map the VLAPIC access page as mmio-direct in the p2m. This
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 27 Dec 2007 12:03:02 +0000 (12:03 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 27 Dec 2007 12:03:02 +0000 (12:03 +0000)
prevents emulated accesses to this page, which would not be handled in
the correct way (VMX handles accesses to that page in non-root mode in
a very super-special way).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/hvm/vmx/vmx.c

index ddf60430d3924a19cc8f4d4a1f1b2a0b37f23c40..1e700d8d2e00eb520f3870088b129852f1786f29 100644 (file)
@@ -2432,8 +2432,8 @@ static int vmx_alloc_vlapic_mapping(struct domain *d)
     if ( apic_va == NULL )
         return -ENOMEM;
     share_xen_page_with_guest(virt_to_page(apic_va), d, XENSHARE_writable);
-    guest_physmap_add_page(
-        d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE), virt_to_mfn(apic_va));
+    set_mmio_p2m_entry(
+        d, paddr_to_pfn(APIC_DEFAULT_PHYS_BASE), _mfn(virt_to_mfn(apic_va)));
     d->arch.hvm_domain.vmx_apic_access_mfn = virt_to_mfn(apic_va);
 
     return 0;